package com.sky.controller.user;

import cn.hutool.json.JSONUtil;
import com.alibaba.druid.support.json.JSONUtils;
import com.sky.constant.RedisConstant;
import com.sky.result.Result;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * ClassName: ShopController
 * Package: com.sky.controller.admin.user
 * Description:
 *
 * @Author: Zhang Peiyuan
 * @Create: 2024-12-20-19:29
 * @Version: v1.0
 */
@RestController("userShopController")
@RequestMapping("/user/shop")
public class ShopController {
    @Resource
    private StringRedisTemplate rds;
    /**
     * 查询店铺状态
     */
    @GetMapping("/status")
    public Result<Integer> queryStatus(){
        String status = rds.opsForValue().get(RedisConstant.SHOP_STATUS);
        return Result.success(Integer.parseInt(status));
    }
}